Data Noice model for information about datasets#1007
Open
k1o0 wants to merge 4 commits into
Open
Conversation
oliche
reviewed
Jul 2, 2026
oliche
left a comment
Collaborator
There was a problem hiding this comment.
Hi
So I've flagged only a missing migration that may be consolidated, the other comments are flagged by AI and I rephrased them.
Other than that I pushed some changes unworthy of being discussed: ruffed and added a missing field in admin.
Collaborator
There was a problem hiding this comment.
If I run ./manage.py makemigrations --check I get this:
Migrations for 'data':
data/migrations/0024_alter_datanotice_options.py
~ Change Meta options on datanotice
This need to be shipped with the release, preferably consolidated in a single migration per app !
| INSIGNIFICANT = 20 | ||
|
|
||
| description = models.TextField(blank=True) | ||
| importance = models.IntegerField( |
Collaborator
There was a problem hiding this comment.
Flagged by AI:
- alyx/data/models.py (DataNotice.IMPORTANCE) — Hand-rolls an IntEnum + manual choices=[(x.value, x.name) for x in IMPORTANCE] where Django's built-in models.IntegerChoices
already provides this (enum + choices + .label for free) with less code — worth switching to the built-in rather than reimplementing it.
| queryset = super().get_queryset() | ||
| queryset = self.serializer_class.setup_eager_loading(queryset) | ||
| # For list endpoints, defer large fields not needed in list responses | ||
| queryset = queryset.defer('description', 'json') |
Collaborator
There was a problem hiding this comment.
Not a big deal if we think there will be less than 100 of such objects but worth excluding those fields altogether in a second serializer if we think we'll have large queries !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is without the special changelog page which I'll push to iblalyx